<?php

/**
 * Project form base class.
 *
 * @package    sistema_estadisticas
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormBaseTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
abstract class BaseFormDoctrine extends sfFormDoctrine
{

	public function setup()
	{
		unset($this['version']);
	}

	public function bind(array $taintedValues = null, array $taintedFiles = null)
	{
		$this->updateAddOnForm($taintedValues);
		parent::bind($taintedValues, $taintedFiles);
	}
	
	protected function doSave($con = null)
	{
		if (null === $con)
		{
			$con = $this->getConnection();
		}

		$this->updateObject();

		if ($this->widgetSchema->offsetExists('anexo'))
		{
			$this->doSaveAddOnForm($con);
			$this->offsetUnset('anexo');
		}
		
		$this->getObject()->save($con);
		$this->saveEmbeddedForms($con);
	}

}
